package com.lutzyt.delivery.controller;

import com.lutzyt.delivery.bean.req.Comment;
import com.lutzyt.delivery.service.CommentService;
import com.lutzyt.delivery.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zyt
 */
@RestController
@RequestMapping("/api/comment")
public class CommentController {

  private CommentService commentService;

  @PostMapping
  public Result<Void> comment(@RequestBody Comment comment){
    commentService.comment(comment);
    return Result.success();
  }

  @Autowired
  public void setCommentService(CommentService commentService) {
    this.commentService = commentService;
  }
}
